<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
		<script src="layui/layui.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<form class="layui-form" action="">
		  <div class="layui-form-item">
		    <label class="layui-form-label">用户名</label>
		    <div class="layui-input-inline">
		      <input type="text" name="loginName" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">密码</label>
		    <div class="layui-input-inline">
		      <input type="password" name="pwd" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">邮箱</label>
		    <div class="layui-input-inline">
		      <input type="text" name="email" required  lay-verify="required" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">手机号</label>
		    <div class="layui-input-inline">
		      <input type="text" name="mtel" required  lay-verify="required" placeholder="请输入手机号" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		      <input type="hidden" name="token" required  lay-verify="required" value="231649c6-3627-4a7c-b1e0-20da6cad93d6" placeholder="请输入token" autocomplete="off" class="layui-input">
		  <div class="layui-form-item">
		    <div class="layui-input-block">
		      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
		      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
		  </div>
		</form>
		 
		<script>
		//Demo
		layui.use(['form','layer','jquery'], function(){
		  var form = layui.form;
		  var layer = layui.layer;
		  var $ = layui.jquery;
		  
		  //监听提交
		  form.on('submit(formDemo)', function(data){
			  //data.elem 代表点击的是哪一个按钮
			  //data.field 代表表单填写的数据
			  //data.form 代表整个表单
			  $.post(
				'http://stuapi.ysd3g.com/api/CreateUser',//请求地址
				data.field,
				function(res){
					layer.msg(res);
				}
			  );
		    return false;//阻止表单提交
		  });
		});
		</script>
	</body>
</html>
